﻿using ProTrack.Entity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ProTrack.IServices.ProductProcess
{
    /// <summary>
    /// 工艺流程业务逻辑层接口
    /// </summary>
    public interface IProRouteServices
    {
        /// <summary>
        /// 获取所有工艺流程信息
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<ProRoute>> GetAllAsync();
        /// <summary>
        /// 根据页码，页大小，工艺路线编号，工艺路线名称，是否启用获取工艺流程信息
        /// </summary>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页大小</param>
        /// <param name="RouteCode">工艺路线编号</param>
        /// <param name="RouteName">工艺路线名称</param>
        /// <param name="EnableFlag">是否启用</param>
        /// <returns></returns>
        public Task<IEnumerable<ProRoute>> GetAsync(int PageIndex, int PageSize, string RouteCode, string RouteName, string EnableFlag);
        /// <summary>
        /// 根据工艺路线编号，工艺路线名称，是否启用获取总条数
        /// </summary>
        /// <param name="RouteCode">工艺路线编号</param>
        /// <param name="RouteName">工艺路线名称</param>
        /// <param name="EnableFlag">是否启用</param>
        /// <returns></returns>
        public Task<int> GetCountAsync(string RouteCode, string RouteName, string EnableFlag);
        /// <summary>
        /// 根据工艺流程编号获取工艺组成表（工艺流程附加表）
        /// </summary>
        /// <param name="RouteId">工艺流程编号</param>
        /// <returns></returns>
        public Task<IEnumerable<ProRouteProcess>> GetProRoutebyIdAsync(string RouteId);
        /// <summary>
        /// 根据工艺流程编号获取产品制程（工艺流程附加表）
        /// </summary>
        /// <param name="RouteId">工艺流程编号</param>
        /// <returns></returns>
        public Task<IEnumerable<ProRouteProduct>> GetProRouteProductbyIdAsync(string RouteId);
        /// <summary>
        /// 根据产品物料ID查询产品制程（工艺流程附加表）是否已经配置了工艺路线
        /// </summary>
        /// <param name="ItemId">产品物料ID</param>
        /// <returns></returns>
        public Task<bool> GetProRouteProductisBool(string ItemId);
        /// <summary>
        /// 更新工艺流程
        /// </summary>
        /// <param name="model">工艺流程模型</param>
        /// <param name="list">工艺组成表（工艺流程附加表）模型</param>
        /// <param name="list2">产品制程（工艺流程附加表）模型</param>
        /// <returns></returns>
        public Task<bool> UpdateAsync(ProRoute model, List<ProRouteProcess> list, List<ProRouteProduct> list2, string InnerFieldName = "RouteId");
        /// <summary>
        /// 新增工艺流程
        /// </summary>
        /// <param name="model">工艺流程模型</param>
        /// <param name="list">工艺组成表（工艺流程附加表）模型</param>
        /// <param name="list2">产品制程（工艺流程附加表）模型</param>
        /// <returns></returns>
        public Task<bool> AddAsync(ProRoute model, List<ProRouteProcess> list, List<ProRouteProduct> list2, string InnerFieldName = "RouteId");
        /// <summary>
        /// 根据编号批量删除工艺流程信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int[] Ids);
        /// <summary>
        /// 根据编号删除指定工艺流程信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int Id);
    }
}
